/************************************************************************

								Heroes IV
					  Copyright 2000, The 3DO Company

	------------------------------------------------------------------
  							 script_trigger_event.h

	$Header: /heroes4/script_trigger_event.h $

	$NoKeywords: $

 ************************************************************************/

#if !defined( SCRIPT_TRIGGER_EVENT_H_INCLUDED )
#define SCRIPT_TRIGGER_EVENT_H_INCLUDED

#if _MSC_VER > 1000
#pragma once
#endif // _MSC_VER > 1000

#include <string>

#include "abstract_script_action.h"
#include "script_action_type.h"

// --------------------------------------------------------------------------
// t_script_trigger_event class
// --------------------------------------------------------------------------

class t_script_trigger_event : public t_abstract_script_action
{
public:
	// Member functions
	std::string const &	get_event_name() const;

	virtual bool		read( std::streambuf& stream, int version );
	virtual bool		read_from_map(
							std::streambuf &	stream,
							int					format_version );
	virtual bool		write( std::streambuf& stream ) const;

	virtual void		execute(t_script_context_hero const& context) const; 
	virtual void		execute(t_script_context_town const& context) const;
	virtual void		execute(t_script_context_object const& context) const;
	virtual void		execute(t_script_context_army const& context) const;
	virtual void		execute(t_script_context_global const& context) const;

private:
	// Data members
	std::string	m_event_name;
};

// --------------------------------------------------------------------------
// t_script_trigger_event inline members
// --------------------------------------------------------------------------

// --------------------------------------------------------------------------
// --------------------------------------------------------------------------
inline std::string const & t_script_trigger_event::get_event_name() const
{
	return m_event_name;
}

SPECIALIZE_SCRIPT_ACTION( k_script_action_trigger_event, t_script_trigger_event );

#endif // !defined( SCRIPT_TRIGGER_EVENT_H_INCLUDED )
